<?php

namespace app\common\model;

use think\Exception;
use think\Model;


class Shb extends Model
{
    protected $autoWriteTimestamp = false;

    protected $table = "os_shb";


    public function getDuihuaArrAttr($value)
    {
        return json_decode($value,true);
    }

    public function setDuihuaArrAttr($value)
    {
        return json_encode($value);
    }

    public function getTimesAttr($value)
    {
        return json_decode($value,true);
    }
    public function setTimesAttr($value)
    {
        return json_encode($value);
    }

    public function getAreasAttr($value)
    {
        return json_decode($value,true);
    }
    public function setAreasAttr($value)
    {
        return json_encode($value);
    }

    public function getIpsAttr($value)
    {
        return json_decode($value,true);
    }
    public function setIpsAttr($value)
    {
        return json_encode($value);
    }

    /**
     * 引导页信息
     */
    public function get_page_info($sn)
    {
        $uid = unlock($sn);

        $res = $this->where('uid','=',$uid)->find();
        if ($res){
            return $res->toArray();
        }
        exit("/**  error sn error or setting empty  */");
    }

}
